package com.yanqu.road.web.timer;

import com.yanqu.road.logic.redis.RedisServerCreateRoleHelper;
import com.yanqu.road.utils.ConfigHelper;
import com.yanqu.road.utils.executor.GeneralTask;
import com.yanqu.road.web.mgr.UserIdMgr;

public class UploadRoleCreateCountToRedisTask extends GeneralTask {
    @Override
    public void doRun() {
        long serverId = ConfigHelper.getLong("serverId");
        long roleCreateCount = UserIdMgr.getTotalRoleCreateCount();
        RedisServerCreateRoleHelper.setRoleCreateCount(serverId, roleCreateCount);
        //有效创角
        RedisServerCreateRoleHelper.setRoleCreateCount2(serverId, UserIdMgr.getTotalRoleCreateCount2());
        getLOGGER().info("upload role create count, {} {}", serverId, roleCreateCount);
        getLOGGER().info("upload role create count2, {} {}", serverId, UserIdMgr.getTotalRoleCreateCount2());
    }
}
